<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>17-v-else-if分支判断语句</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
      .box {
        width: 100px;
        height: 100px;
        border: 1px solid red;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <span v-if="score === 50">50分</span>
      <span v-else-if="score >= 80 && score <= 90">你是个天才</span>
      <span v-else>分数未知</span>

      <div class="box" v-show="flag">盒子</div>
      <button class="btn" @click="btnhandle">show</button>
    </div>
    <script>
      var vm = new Vue({
        el: '#app',
        data: {
          score: 80,
          flag: false,
        },
        methods: {
          btnhandle: function () {
            this.flag = !this.flag;
          },
        },
      });
    </script>
  </body>
</html>
